import Vue from "vue";
import VueRouter from "vue-router";
// 导入所有的页面
import Home from "../views/Home.vue";
import About from "../views/About.vue";
import Cart from '../views/Cart.vue';
import AddressManage from '../views/AddressManage.vue';
import Login from '../views/Login.vue';
import My from '../views/My.vue';
import Detail from '../views/Detail.vue';
import OrderSubmit from '../views/OrderSubmit.vue';
import Search from '../views/Search.vue'

Vue.use(VueRouter);

// 路由表
const routes = [
    {
        path: "/", // 访问路径
        name: "Home", // 该页面的名称
        component: Home, // 该页面对应vue组件
    },
    {
        path: "/cate",
        name: "Cate",
        component: About,
    },
    {
        path:"/cart",
        name:"Cart",
        component:Cart
    },
    {
        path:"/address",
        name:"Addr",
        component:AddressManage
    },
    {
        path:"/login",
        name:"Login",
        component:Login
    },
    {
        path:"/my",
        name:"My",
        component:My
    },
    {
        path:"/detail",
        name:"Detail",
        component:Detail
    },
    {
        path:"/submit-order",
        name:"OrderSubmit",
        component:OrderSubmit
    },
    {
        path:"/search",
        name:"Serach",
        component:Search
    }
];

const router = new VueRouter({
    routes,
});

export default router;
